#include <iostream>
#include <array>
#include "math_utils.hpp"

inline void print_section(const char* title) {
  std::cout << "\n=== " << title << " ===\n";
}

int main() {
  print_section("inline 函数");
  std::cout << "add(3, 4) = " << add(3, 4) << '\n';

  print_section("inline constexpr 变量");
  std::cout << "kPi = " << kPi << '\n';

  print_section("inline constinit 变量");
  std::cout << "g_init_calls (before) = " << g_init_calls << '\n';
  ++g_init_calls;
  std::cout << "g_init_calls (after) = " << g_init_calls << '\n';

  print_section("inline 函数模板");
  std::array<int, 5> values{1, 2, 3, 4, 5};
  std::cout << "sum(values) = " << sum(values) << '\n';

  print_section("inline static 成员");
  Stats s1, s2;
  std::cout << "Stats::object_count = " << Stats::object_count << '\n';

  return 0;
}